/**
 * 
 */
$(document).ready(function() {
    $('#registform').bootstrapValidator({
        message: 'This value is not valid',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
                userName: {
                message: '用户名不合法！',
                validators: {
                    notEmpty: {
                        message: '请输入用户名！'
                    },
                    stringLength: {
                        min: 6,
                        max: 30,
                        message: '用户名只能由6-30个字组成！'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_]+$/,
                        message: '用户名只能由字母、数字或下划线组成！'
                    }
                }
            },
            Email: {
                validators: {
                    notEmpty: {
                        message: '请输入邮箱'
                    },
                    emailAddress: {
                        message: 'The input is not a valid email address'
                    }
                }
            },
            userPwd:{
            	validators: {
                    notEmpty: {
                        message: '请输入密码!'
                    },
            }
        },
        Name:{
        	validators: {
                notEmpty: {
                    message: '请输入姓名!'
                },
        }
    },
    userGender:{
    	validators: {
            notEmpty: {
                message: '请输入性别!'
            },
    }
},
   idCard:{
    	validators: {
            notEmpty: {
                message: '请输入证件号码!'
            },
    }
},
        pwd2:{
        	validators: {
                notEmpty: {
                    message: '请输入确认密码!'
                },
        }
    },
            agreeement:{
            	validators: {
                    notEmpty: {
                        message: '需要先阅读协议!'
                    },
            }
        },
            mycall: {
                message: '手机号码不正确！',
                validators: {
                    notEmpty: {
                        message: '请输入手机号！'
                    },
                    stringLength: {
                        min: 11,
                        max: 11,
                        message: '手机号位数不对！'
                    },
                    regexp: {
                        regexp: /^[0-9]+$/,
                        message: '手机号格式不对！'
                    }
                }
            }
        }
    });
});
function isValid(){
	if(userPwd.value!=pwd2.value){
		$("#myModal").modal('show');
		return false;
	}
	
		return true;
}